﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/DigitalTV.Master" CodeBehind="ManterCliente.aspx.cs" Inherits="UI.ManterCliente" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="Principal" style="width:380px">

        <div id="Consulta" style="width:400px">
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" DataSourceID="ClienteDS">
            <Columns>
                <asp:BoundField DataField="Cpf" HeaderText="Cpf" SortExpression="Cpf" />
                <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                <asp:BoundField DataField="Endereco" HeaderText="Endereco" 
                    SortExpression="Endereco" />
                <asp:BoundField DataField="Telefone" HeaderText="Telefone" 
                    SortExpression="Telefone" />
                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                <asp:BoundField DataField="DataNasc" HeaderText="DataNasc" 
                    SortExpression="DataNasc" />
            </Columns>
        </asp:GridView>
            <asp:ObjectDataSource ID="ClienteDS" runat="server" DeleteMethod="deletar" 
                InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="Consultar" TypeName="Negocios.ClienteMetodos" 
                UpdateMethod="alterar">
                <DeleteParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                    <asp:Parameter Name="nome" Type="String" />
                    <asp:Parameter Name="endereco" Type="String" />
                    <asp:Parameter Name="telefone" Type="String" />
                    <asp:Parameter Name="email" Type="String" />
                    <asp:Parameter Name="dataNasc" Type="DateTime" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:Parameter Name="nome" Type="String" />
                </SelectParameters>
                <InsertParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                    <asp:Parameter Name="nome" Type="String" />
                    <asp:Parameter Name="endereco" Type="String" />
                    <asp:Parameter Name="telefone" Type="String" />
                    <asp:Parameter Name="email" Type="String" />
                    <asp:Parameter Name="dataNasc" Type="DateTime" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="ClientesDS" runat="server" DeleteMethod="deletar" 
                InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="getCliente" TypeName="Negocios.ClienteMetodos" 
                UpdateMethod="alterar">
                <DeleteParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                    <asp:Parameter Name="nome" Type="String" />
                    <asp:Parameter Name="endereco" Type="String" />
                    <asp:Parameter Name="telefone" Type="String" />
                    <asp:Parameter Name="email" Type="String" />
                    <asp:Parameter Name="dataNasc" Type="DateTime" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                </SelectParameters>
                <InsertParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                    <asp:Parameter Name="nome" Type="String" />
                    <asp:Parameter Name="endereco" Type="String" />
                    <asp:Parameter Name="telefone" Type="String" />
                    <asp:Parameter Name="email" Type="String" />
                    <asp:Parameter Name="dataNasc" Type="DateTime" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="odsClientes" runat="server" DeleteMethod="deletar" 
                InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="getCliente" TypeName="Negocios.ClienteMetodos">
                <DeleteParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                </DeleteParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="tbCpf" Name="cpf" PropertyName="Text" 
                        Type="String" />
                </SelectParameters>
                <InsertParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                    <asp:Parameter Name="nome" Type="String" />
                    <asp:Parameter Name="endereco" Type="String" />
                    <asp:Parameter Name="telefone" Type="String" />
                    <asp:Parameter Name="email" Type="String" />
                    <asp:Parameter Name="dataNasc" Type="DateTime" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <table border="1">
                </table>
    </div>
        <div id="Cadastro" class="divDados" style="width:400px">

            <table border="1">
                <tr>
                    <td>
                        CPF:</td>
                    <td>
                        <asp:TextBox ID="tbCpf" runat="server" Enabled="False"></asp:TextBox>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btNovo" runat="server" Text="Novo" Width="114px" 
                            onclick="btNovo_Click" />
                    </td>
                </tr>
                <tr>
                    <td>
                        NOME:</td>
                    <td>
                        <asp:TextBox ID="tbNome" runat="server" Width="231px" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        ENDEREÇO:</td>
                    <td>
                        <asp:TextBox ID="tbEndereco" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        TELEFONE:</td>
                    <td>
                        <asp:TextBox ID="tbTelefone" runat="server" Height="30px" TextMode="MultiLine" 
                            Width="231px" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        EMAIL:</td>
                    <td>
                        <asp:TextBox ID="tbEmail" runat="server" Width="231px" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        DATA NASCIMENTO:</td>
                    <td>
                        <asp:TextBox ID="tbDataNascimento" runat="server" Width="231px" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btGravar" runat="server" Text="Gravar" Width="114px" 
                            onclick="btGravar_Click" />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btCancelar" runat="server" Text="Cancelar" 
                            onclick="btCancelar_Click" />
                    </td>
                </tr>
            </table>
            </div>
            </div>
</asp:Content>